package com.biz.primus.ms.sms.dao.po;

import com.biz.primus.model.misc.enums.DeliveryState;
import com.biz.primus.ms.base.jpa.po.BaseEntity;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * @author yanweijin
 * @date 2017/5/30
 */
@Entity
@Table(name = "cmp_send_record", indexes = {@Index(columnList = "mobile"), @Index(columnList = "task_id")})
@Getter
@Setter
public class SendRecord extends BaseEntity {

    private static final long serialVersionUID = 1851799534657895929L;
    @Column(length = 16, nullable = false)
    private String mobile;

    @Enumerated(EnumType.STRING)
    @Column(length = 32, name = "delivery_state")
    private DeliveryState deliveryState;

    //短信发送task
    @ManyToOne(optional = false)
    private SendTask task;

    @Column(name = "delivery_timestamp")
    private Timestamp deliveryTimestamp;


}
